home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / IAC_STUF / README < prev    next >
Text File  |  1989-11-29  |  2KB  |  47 lines

  1.  
  2.                 Simple Macintosh Interapplication Communication
  3.                 
  4. The files in this folder implement an efficient, but very simple form of
  5. interapplication communication.  At the heart of the system is a simple driver
  6. that responds to registration and lookup requests from applications.  Buffer space
  7. is allocated for each registered application and the lookup request simply returns a
  8. pointer to that buffer space.  All communcation between the applications is via direct
  9. memory reads/writes to and from the assigned buffers and can therefore be extremely
  10. efficient.  How the buffer memory is used is completely up to the applications, but
  11. I've included some C routines that support simple buffering for multiple messages.
  12.  
  13. Note that because of the simplicity of this scheme, the applications do have to be
  14. reasonably cooperative.  When an application (A) looks up another application (B) it
  15. gets a pointer to a buffer.  If application B later deregisters itself without first
  16. telling A, then A could continue to use the invalid buffer pointer and possibly crash
  17. the system.
  18.  
  19. Note that the driver tries to install itself in slot 29 and does not make any attempt
  20. to check the unit table first to be sure that slot is not in use.  This has never
  21. caused me any problems but it's possible that someone out there would already have
  22. something in that slot.
  23.  
  24. This folder contains the following files:
  25.  
  26. IAC-Driver.╣ and IAC-Driver.c:
  27.     Think C 4.0 project and source for the driver.
  28.     
  29. IAC:
  30.     The driver.  Created by the IAC-Driver project.  Copy the resources from this
  31.     file into your application's resource file.  Make sure that the system heap flags
  32.     are set on the DATA and DRVR resources when you copy them.
  33.     
  34. IAC.c:
  35.     Convenient C routines for opening the driver and managing the buffers.
  36.  
  37. TestApp.╣, TestApp.╣.rsrc and TestApp:
  38.     Simple application for testing out the interapplication communication.  Make
  39.     another copy of TestApp, start them both up.  Any messages typed in the window
  40.     of one of the applications will appear in the window of the other.  Type 'quit'
  41.     to exit from both applications.
  42.     
  43. KillDriver.╣ and KillDriver:
  44.     Simple routine to remove close the driver and deallocate any buffers it might
  45.     have created.
  46.     
  47.